/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */

package org.baatar.remoting.service;

import org.apache.log4j.Logger;

/**
 * Interface for all classes which will implement remoting business logic.
 * 
 * These classes receive requests from ImplementorTCPBridge and after processing
 * requests they pass responses to bridge objects again.
 * 
 * @see ImplementorTCPBridge
 * 
 * @author B_ZEREN
 */
public interface IImplementor {

    /**
     * Initializes the implementor object.
     * 
     * @return boolean true if initialization completed succesfully.
     * 
     * @throws Exception 
     */
    public boolean initialize() throws Exception;

    /**
     * Finalizes the implementor object.
     * 
     * @throws Exception 
     */
    public void uninitialize() throws Exception;

    /**
     * Starts the implementor object.
     * It is necessary if it also implements a thread manager object.
     * 
     * @return boolean true if it successfully started.
     */
    public boolean start();

    /**
     * Stops the implementor object.
     * It is necessary if it also implements a thread manager object.
     * 
     * @return boolean true if it successfully stopped.
     */
    public boolean stop();

    /**
     * Sets the owner remoting service of the implementor object.
     * 
     * @param remotingService which is owner of the implementor object.
     */
    public void setRemotingService(RemotingService remotingService);

    /**
     * Sets the logger of the implementor object.
     * 
     * @param logger logger of the implementor object.
     */
    public void setLogger(Logger logger);
}
